﻿@extends("admin.base.base")
@section("title")
	<title>图片列表</title>
@endsection
@section("content")
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 基地管理 <span class="c-gray en">&gt;</span> 待审核基地 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="text-c" style="text-align: right">
        {{--<form action="{{url('admin/search')}}" method="post">--}}
            {{--<input type="text" name="keywords" id="" placeholder=" 基地名称" style="width:250px" class="input-text">--}}
            {{--{{csrf_field()}}--}}
            {{--<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜基地</button>--}}
        {{--</form>--}}
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l"> <a class="btn btn-danger radius" data-href="" href="{{url('admin/examine')}}">待审核列表</a></span>
        <span class="r">共有数据：<strong>{{$item->total()}}</strong> 条</span>
    </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
			<tr class="text-c">
				<th><input name="" type="checkbox" value=""></th>
				<th>ID</th>
				<th>已认证承办机构</th>
				<th>创建时间</th>
				<th>审核状态</th>
				<th>操作</th>
			</tr>
			</thead>
			<tbody>
            @foreach($item as $items)
                <tr class="text-c">
                    <td><input name="" type="checkbox" value=""></td>
                    <td>{{$items->id}}</td>
                    <td>{{$items->name}}</td>
                    <td>{{$items->created_at}}</td>
                    @if($items->state == 1)
                        <td class="td-status"><span class="label label-success radius">审核通过</span></td>
                    @endif
                    <td class="td-manage"> <a style="text-decoration:none" class="ml-5" onClick="picture_show('查看承办机构','{{url('admin/success-mechanism/'.$items->id)}}','{{$items->id}}')" href="javascript:;" title="查看"><i class="Hui-iconfont">&#xe665;</i></a> <a style="text-decoration:none" class="ml-5" onClick="picture_del(this,'{{$items->id}}')" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
                </tr>
            @endforeach
            {{csrf_field()}}
            {{method_field('DELETE')}}
			</tbody>
		</table>
	</div>
</div>
@endsection
@section("js")
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="{{asset('lib/My97DatePicker/4.8/WdatePicker.js')}}"></script>
<script type="text/javascript" src="{{asset('lib/datatables/1.10.0/jquery.dataTables.min.js')}}"></script>
<script type="text/javascript" src="{{asset('lib/laypage/1.2/laypage.js')}}"></script>
<script type="text/javascript">
    $('.table-sort').dataTable({
        "aaSorting": [[ 1, "desc" ]],//默认第几个排序
        "bStateSave": true,//状态保存
        "aoColumnDefs": [
            //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
            {"orderable":false,"aTargets":[0,5]}// 制定列不参与排序
        ]
    });

    /*图片-查看*/
    function picture_show(title,url,id){
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }


    /*图片-删除*/
    function picture_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                type: 'POST',
                method: 'DELETE',
                url: '{{url('admin/success-mechanism')}}'+'/'+id,
                data:{'_token':'{{csrf_token()}}'},
                dataType: 'json',
                success: function(data){
                    if (data.code == 0){
                        $(obj).parents("tr").remove();
                        layer.msg(data.msg,{icon:1,time:1000});
                    }else {
                        layer.msg(data.msg);
                    }
                }
            });
        });
    }
</script>
@endsection